package org.example.operator.impl;

import org.example.operator.Operator;

import java.math.BigDecimal;

import static java.math.BigDecimal.ROUND_HALF_UP;

public class DivideOperator implements Operator {
    @Override
    public String operate(BigDecimal num1, BigDecimal num2) {
        assert num2.compareTo(BigDecimal.ZERO)!=0 : "除数不能为0";
        return num1.divide(num2,6,ROUND_HALF_UP).toString();
    }
}
